package cate.game.role.res.hero.introduction.msg;

import cate.common.annotation.OperationSetter;
import cate.common.table.d.GDOperation;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBIntroduction;
import easy.java.dev.note.NoteField;
import easy.java.practice.errorcode.EcResult;

@ClientMsg(title = "领取英雄图鉴奖励 の 请求")
@OperationSetter(value = GDOperation.INTRODUCTION_HERO_REWARD, sub = "heroTid")
public class GetHeroRwdReq implements MsgInput {
    @NoteField(value = "原型ID")
    public int heroTid;

    @Override
    public void execute(GameBody game, ClientContext cc) {
        EcResult<Void> r = cc.getRole().getRes().heroIntroduction.getHeroRwd(heroTid);
        if(!r.ok()){
            game.notice.message(cc.getRole(), r.message);
        }
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBIntroduction.GET_HERO_REWARD_REQ;
    }
}
